import React, { useState, useEffect } from 'react';
import 'antd/dist/antd.css'
import '../css/index.scss'
import { Table, Button, Select, Space, Modal,Form,Switch,Input,message } from 'antd';
import axios from '../../../../../http/index'


export default function Add(props) {
    console.log(props.seedatas);
    const [seedatas,setseedatas] = useState({
        couponName:props.seedatas.title,
        selects:String(props.seedatas.elpcenter_show),
        see:true,
        see2:true,
        couponName2:props.seedatas.release_time,
        couponName3:props.seedatas.helpcenter_number,
    })
    const layout = {
        labelCol: { span: 5 },
        wrapperCol: { span: 19 },
    };
    const onFinish = (values) => {
        console.log(values);
    };
  const gender = () => {

  }
  const see = () => {

  }
  const couponName = () => {

  }
    return (
        <div>
              <Form {...layout} name="nest-messages"
                    onFinish={onFinish}
                    initialValues={{
                        ...seedatas
                    }}
                > <Form.Item name='couponName3' label="编号" >
                <Input onBlur={couponName} placeholder="请输入标题" disabled/>
            </Form.Item>
                    <Form.Item name='couponName' label="标题">
                        <Input onBlur={couponName} placeholder="请输入标题" disabled/>
                    </Form.Item>
                   
                    <Form.Item label="分类名称" name='selects' >
                        <Select placeholder="请选择分类名称" onChange={gender} getPopupContainer={triggerNode => triggerNode.parentNode} disabled>
                            <Select.Option value="1">常见问题</Select.Option>
                            <Select.Option value="2">金融问题</Select.Option>
                            <Select.Option value="3">售后问题</Select.Option>
                        </Select>
                    </Form.Item>
                    <Form.Item name='see' label="显示设置">
                        <Switch checkedChildren="是" unCheckedChildren="否" defaultChecked onChange={see} defaultChecked={seedatas.dynamic === 1 ?  false : true} disabled/>
                    </Form.Item>
                    <Form.Item name='couponName2' label="发布时间" >
                        <Input onBlur={couponName} placeholder="请输入标题" disabled/>
                    </Form.Item>
                    <Form.Item name='see2' label="是否可查看">
                        <Switch checkedChildren="是" unCheckedChildren="否" defaultChecked onChange={see} defaultChecked={seedatas.see === 2 ?  false : true} disabled/>
                    </Form.Item>
                   
                </Form>

        </div>
    )
}
